<!--SIF Implementation Specification 2.2-6 (March 17, 2008)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.sifinfo.org/infrastructure/2.x" xmlns:sif="http://www.sifinfo.org/infrastructure/2.x" elementFormDefault="qualified">
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="imports/xml/xml.xsd" />
  <xs:complexType name="BusPositionInfoType">
    <xs:annotation>
      <xs:documentation>This object exposes telematics information to the zone.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Date" type="xs:date">
        <xs:annotation>
          <xs:documentation>The date of the report from the bus.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Time" type="xs:time">
        <xs:annotation>
          <xs:documentation>The time of the report from the bus.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="GridLocation" type="sif:GridLocationType">
        <xs:annotation>
          <xs:documentation>The location of the bus.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TelematicsId" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:documentation>ID of the hardware unit on the bus that tracks &amp; reports location and status. The interpretation of the content is deployment specific, but the format must be compact.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TelemetryList" minOccurs="0" nillable="true">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Telemetry" minOccurs="0" maxOccurs="unbounded" type="xs:normalizedString">
              <xs:annotation>
                <xs:documentation>Indicators and values provided by the hardware along with this position snapshot. For events, it is safe to assume that one of these items triggered the hardware to issue an update.</xs:documentation>
              </xs:annotation>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="BusDriver" minOccurs="0" nillable="true">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Name" minOccurs="0" nillable="true" type="sif:NameType">
              <xs:annotation>
                <xs:documentation>The name of the driver. Condition is that at least one of this and EmployeePersonalRefId must be included.</xs:documentation>
              </xs:annotation>
            </xs:element>
            <xs:element name="EmployeePersonalRefId" minOccurs="0" nillable="true" type="sif:IdRefType">
              <xs:annotation>
                <xs:documentation>The GUID of the driver's EmployeePersonal object. Condition is that at least one of this and BusDriver/Name must be included.</xs:documentation>
              </xs:annotation>
            </xs:element>
            <xs:element name="Status">
              <xs:annotation>
                <xs:documentation>Boarding status of the driver.</xs:documentation>
              </xs:annotation>
              <xs:simpleType>
                <xs:restriction base="xs:token">
                  <xs:enumeration value="On">
                    <xs:annotation>
                      <xs:documentation>Driver boarded the bus and no exit detected</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="Off">
                    <xs:annotation>
                      <xs:documentation>Driver exited the bus</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="Sched">
                    <xs:annotation>
                      <xs:documentation>Scheduled for this run, but either hasn't boarded or the telematics hardware can't confirm who the driver is</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="BusStaffList" minOccurs="0" nillable="true">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="BusStaff" minOccurs="0" maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="Name" minOccurs="0" nillable="true" type="sif:NameType">
                    <xs:annotation>
                      <xs:documentation>The name of this staff member. Condition is that at least one of this and EmployeePersonalRefId must be included.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="EmployeePersonalRefId" minOccurs="0" nillable="true" type="sif:IdRefType">
                    <xs:annotation>
                      <xs:documentation>The GUID of the employee's EmployeePersonal object. Condition is that at least one of this and BusStaff/Name must be included.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="Status">
                    <xs:annotation>
                      <xs:documentation>Boarding status of this staff member.</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                      <xs:restriction base="xs:token">
                        <xs:enumeration value="On">
                          <xs:annotation>
                            <xs:documentation>Boarded the bus and no exit detected</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="Off">
                          <xs:annotation>
                            <xs:documentation>Exited the bus</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="Sched">
                          <xs:annotation>
                            <xs:documentation>Scheduled for this run, but either hasn't boarded or the telematics hardware can't confirm this staff's identity</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="RouteStatus" minOccurs="0" nillable="true">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="BusRouteInfoRefId" type="sif:IdRefType">
              <xs:annotation>
                <xs:documentation>The GUID that identifies the route.</xs:documentation>
              </xs:annotation>
            </xs:element>
            <xs:element name="Status">
              <xs:annotation>
                <xs:documentation>Status of the route.</xs:documentation>
              </xs:annotation>
              <xs:simpleType>
                <xs:restriction base="xs:token">
                  <xs:enumeration value="Begin">
                    <xs:annotation>
                      <xs:documentation>No students have been picked up yet</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="End">
                    <xs:annotation>
                      <xs:documentation>All students have been dropped off</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="Continue">
                    <xs:annotation>
                      <xs:documentation>In the midst of a run</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="OtherStatus" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:documentation>If the bus is not running a regularly scheduled route but is transporting (or positioning to transport) passengers as approved and directed by the school district, this element describes the activity. It's also used for maintenance, repair, and other authorized movements. This element is mutually exclusive with RouteStatus. Absence of both RouteStatus and OtherStatus is acceptable, but may indicate unauthorized operation.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Odometer" minOccurs="0" nillable="true">
        <xs:annotation>
          <xs:documentation>Current odometer reading.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:simpleContent>
            <xs:extension base="xs:decimal">
              <xs:attribute name="Unit" use="required">
                <xs:annotation>
                  <xs:documentation>Units used in the odometer reading.</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                  <xs:restriction base="xs:token">
                    <xs:enumeration value="km">
                      <xs:annotation>
                        <xs:documentation>Kilometers</xs:documentation>
                      </xs:annotation>
                    </xs:enumeration>
                    <xs:enumeration value="m">
                      <xs:annotation>
                        <xs:documentation>Miles</xs:documentation>
                      </xs:annotation>
                    </xs:enumeration>
                  </xs:restriction>
                </xs:simpleType>
              </xs:attribute>
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
      <xs:element name="Speedometer" minOccurs="0" nillable="true">
        <xs:annotation>
          <xs:documentation>Current speedometer reading.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:simpleContent>
            <xs:extension base="xs:decimal">
              <xs:attribute name="Unit" use="required">
                <xs:annotation>
                  <xs:documentation>Units used in the speedometer reading. </xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                  <xs:restriction base="xs:token">
                    <xs:enumeration value="km">
                      <xs:annotation>
                        <xs:documentation>Kilometers/hour</xs:documentation>
                      </xs:annotation>
                    </xs:enumeration>
                    <xs:enumeration value="m">
                      <xs:annotation>
                        <xs:documentation>Miles/hour</xs:documentation>
                      </xs:annotation>
                    </xs:enumeration>
                  </xs:restriction>
                </xs:simpleType>
              </xs:attribute>
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
      <xs:element name="Students" minOccurs="0" nillable="true">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Student" minOccurs="0" maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="StudentPersonalRefId" type="sif:IdRefType">
                    <xs:annotation>
                      <xs:documentation>GUID that identifies the student that this element refers to.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="Status">
                    <xs:annotation>
                      <xs:documentation>
								Boarding status of this student.  Note: Values Sched, On and Off are typical of responses.  Values Entered
								and Exited are typical of events.
							</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                      <xs:restriction base="xs:token">
                        <xs:enumeration value="On">
                          <xs:annotation>
                            <xs:documentation>Student boarded the bus and no exit detected</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="Off">
                          <xs:annotation>
                            <xs:documentation>Student exited the bus</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="Entered">
                          <xs:annotation>
                            <xs:documentation>Boarded the bus since previous event</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="Exited">
                          <xs:annotation>
                            <xs:documentation>Left the bus since previous event</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="Sched">
                          <xs:annotation>
                            <xs:documentation>Scheduled for this run, but either hasn't boarded or the telematics hardware can't confirm student identities</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="SIF_Metadata" minOccurs="0" nillable="true" type="sif:SIF_MetadataType" />
      <xs:element name="SIF_ExtendedElements" minOccurs="0" nillable="true" type="sif:SIF_ExtendedElementsType" />
    </xs:sequence>
    <xs:attribute name="BusInfoRefId" use="required" type="sif:IdRefType">
      <xs:annotation>
        <xs:documentation>The GUID that identifies the bus. This object only has meaning as current data for this particular bus.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:element name="BusPositionInfo" type="sif:BusPositionInfoType" />

</xs:schema>